package com.weic.controller;

import com.weic.pojo.Dept;
import com.weic.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(value = "/thymeleaf")
public class ThymeleafController {

    @Autowired
    DeptService deptService;

    @RequestMapping(value = "/helloThymeleaf")
    public ModelAndView helloThymeleaf(){
        ModelAndView modelAndView = new ModelAndView("helloThymeleaf");
        List<Dept> deptList = deptService.getAll(0,4);
        Map<String, Object> model = modelAndView.getModel();
        model.put("msg", "testMessage");
        model.put("deptList", "deptList");
        System.out.println(1111);
        return modelAndView;
    }
}

